Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feature: adding action_identifier for each client in get_info #382

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

mraniki
Copy link
Owner

@mraniki mraniki commented Jul 8, 2024

Summary by Sourcery

This pull request enhances the get_info method by including an action_identifier for each client, providing more detailed information.

  • New Features:
    • Added action_identifier for each client in the get_info method.

Copy link

sourcery-ai bot commented Jul 8, 2024

Reviewer's Guide by Sourcery

This pull request enhances the get_info method in findmyorder/main.py by adding an action_identifier for each client. The client_info string construction was updated to include this new attribute, providing more detailed information about each client.

File-Level Changes

Files Changes
findmyorder/main.py Enhanced the get_info method to display action_identifier for each client.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mraniki - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -153,7 +153,10 @@ async def get_info(self):
"""
version_info = f"ℹ️ {type(self).__name__} {__version__}\n"
client_info = "".join(f"🔎 {client.name}\n" for client in self.clients)
client_info = "".join(
f"🔎 {client.name}\n🔠 {client.action_identifier}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Consider handling cases where client.action_identifier might be None or empty.

If client.action_identifier can be None or an empty string, it might be better to handle these cases explicitly to avoid unexpected output.

Suggested change
f"🔎 {client.name}\n🔠 {client.action_identifier}"
f"🔎 {client.name}\n🔠 {client.action_identifier or 'N/A'}"

client_info = "".join(f"🔎 {client.name}\n" for client in self.clients)
client_info = "".join(
f"🔎 {client.name}\n🔠 {client.action_identifier}"
for client in self.clients
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider the performance impact of the join operation inside a generator expression.

While the current implementation is likely efficient for a small number of clients, if self.clients can be large, it might be worth considering alternative approaches to improve performance.

Suggested change
for client in self.clients
client_info = []
for client in self.clients:
client_info.append(f"🔎 {client.name}\n🔠 {client.action_identifier}")
client_info = "".join(client_info)

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a6f37d7) to head (29a5f1b).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #382   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          137       137           
=========================================
  Hits           137       137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mraniki mraniki merged commit 9738ded into main Jul 8, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant